'''
集合中的运算符号:
  在集合中不支持(*,+)
  - 差集 函数是difference()
  & 交集 函数是intersection()
  | 并集 函数是union()
  ^ 对称差集 函数是symmetric_difference()
'''
set1 = {1,2,3,4,5,6}
set2 = {1,2,3,4,5,6,7,8}
result = set2 - set1
result1 = set2 & set1
result2 = set2 | set1
result3 = set2.difference(set1)
result4 = set2.intersection(set1)
result5 = set2.union(set1)
print(result)
print(result1)
print(result2)
print(result3)
print(result4)
print(result5)
print('-' * 20)
#求集合set1和集合set2中不同的元素
set1 = {1,2,4,5,6}
set2 = {1,2,3,5,7,8}
result6 = (set2 | set1) - (set2 & set1)
result7= set2.symmetric_difference(set1)
print(result6)
print(result7)
